SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 55693: A segmentation violation occurs when you are using SAS/ACCESS® Interface to DB2 and running code against a DB2 database

DetailsAboutRate It

When querying a DB2 database with SAS/ACCESS Interface to DB2, you might receive a segmentation violation error like the following:

ERROR: An exception has been encountered. Please contact technical support and provide them with the following traceback information: The SAS task name is <task used> Segmentation Violation Traceback of the Exception: /opt/sas94/bin/SASFoundation/9.4/sasexe/sas() [0x525d1e] /opt/sas94/bin/SASFoundation/9.4/sasexe/sas() [0x41ebee] /opt/sas94/bin/SASFoundation/9.4/sasexe/tkmk.so(bkt_signal_handler+0x144) [0x2ad41a1b9514] /lib64/libpthread.so.0() [0x31a540f710] /opt/sas94/bin/SASFoundation/9.4/sasexe/tkmk.so(skm_free_container+0x8) [0x2ad41a1cbf88] /opt/sas94/bin/SASFoundation/9.4/sasexe/tkmk.so(skm_release_large_chunk+0x3e) [0x2ad41a1ca61e] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasxdbi(dbifbf+0x39) [0x2ad477f6d099] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasxdbi(dbifopn+0x20) [0x2ad477f7bd60] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasxdbi(yoeclos+0x317) [0x2ad477f4a607] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasyoio(yoclose+0x9bd) [0x2ad471554f6d] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasiomet(yoeclos+0x11a) [0x2ad47765f15a] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasyoio(yoclose+0x9bd) [0x2ad471554f6d] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasyh(yorclnp+0x4f9) [0x2ad429b88109] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasyh(yhcstep+0x18) [0x2ad429b7dd68] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasxkern(yakrext+0x327) [0x2ad42924d167] /opt/sas94/bin/SASFoundation/9.4/sasexe/sas() [0x413da5] /opt/sas94/bin/SASFoundation/9.4/sasexe/sas() [0x4110a6] /opt/sas94/bin/SASFoundation/9.4/sasexe/sas(wtdelet+0x48) [0x411438] /opt/sas94/bin/SASFoundation/9.4/sasexe/sasds(sasds+0x39e) [0x2ad4654be23e] /opt/sas94/bin/SASFoundation/9.4/sasexe/sas(vvtentr+0x101) [0x41e801] /lib64/libpthread.so.0() [0x31a54079d1] /lib64/libc.so.6(clone+0x6d) [0x31a50e8b6d]

The error occurs if the DB2 encoding is not set properly. To determine the DB2 encoding used on the DB2 server, run this query in the DB2 Command Line Processor:

select codepage from syscat.datatypes where typename='varchar';

The query returns a number. Use that number as the value for the DB2CODEPAGE environment variable.

  • If SAS/ACCESS Interface to DB2 is installed in a Windows operating environment, follow these steps to set the DB2CODEPAGE environment variable:
    1. Navigate to Control Panel ► System ► Advanced system settings .
    2. The System Properties dialog box appears. If necessary, click the Advanced tab.
    3. Click the Environment Variables button.
    4. In the System variables section, click New.
    5. In the New System Variable box, enter DB2CODEPAGE in the Variable name field.
    6. In the Variable value field, enter the value that was returned when you ran the query in Step 1.
    7. Click OK.
  • If SAS/ACCESS Interface to DB2 is installed in a UNIX operating environment, follow these steps to set the DB2CODEPAGE environment variable:
    1. Open the sasenv_local file, located in the !SASROOT/bin.
    2. Add this command to the file: export DB2CODEPAGE DB2CODEPAGE value

Another way to resolve the error is to set the SAS_ACCESS_PIPELINEREAD=OFF environment variable. However, this affects all SAS/ACCESS products by turning off pipeline reads. Pipeline reads were added to SAS® 9.4. By turning off pipeline reads, data reads are performed the way they were in previous SAS releases.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to DB2Solaris for x649.4 TS1M19.4 TS1M3
Linux for x649.4 TS1M19.4 TS1M3
Microsoft Windows 8 Enterprise x649.4 TS1M19.4 TS1M3
Microsoft Windows 8 Enterprise 32-bit9.4 TS1M19.4 TS1M3
HP-UX IPF9.4 TS1M19.4 TS1M3
64-bit Enabled Solaris9.4 TS1M19.4 TS1M3
64-bit Enabled AIX9.4 TS1M19.4 TS1M3
Windows 7 Ultimate x649.4 TS1M19.4 TS1M3
Windows 7 Ultimate 32 bit9.4 TS1M19.4 TS1M3
Windows 7 Professional x649.4 TS1M19.4 TS1M3
Windows 7 Professional 32 bit9.4 TS1M19.4 TS1M3
Windows 7 Home Premium x649.4 TS1M19.4 TS1M3
Windows 7 Home Premium 32 bit9.4 TS1M19.4 TS1M3
Windows 7 Enterprise x649.4 TS1M19.4 TS1M3
Windows 7 Enterprise 32 bit9.4 TS1M19.4 TS1M3
Microsoft Windows Server 2012 Std9.4 TS1M19.4 TS1M3
Microsoft Windows Server 2012 R2 Std9.4 TS1M19.4 TS1M3
Microsoft Windows Server 2012 R2 Datacenter9.4 TS1M19.4 TS1M3
Microsoft Windows Server 2012 Datacenter9.4 TS1M19.4 TS1M3
Microsoft Windows Server 2008 for x649.4 TS1M19.4 TS1M3
Microsoft Windows Server 2008 R29.4 TS1M19.4 TS1M3
Microsoft Windows Server 20089.4 TS1M19.4 TS1M3
Microsoft Windows 8.1 Pro 32-bit9.4 TS1M19.4 TS1M3
Microsoft Windows 8.1 Pro9.4 TS1M19.4 TS1M3
Microsoft Windows 8.1 Enterprise x649.4 TS1M19.4 TS1M3
Microsoft Windows 8.1 Enterprise 32-bit9.4 TS1M19.4 TS1M3
Microsoft Windows 8 Pro x649.4 TS1M19.4 TS1M3
Microsoft Windows 8 Pro 32-bit9.4 TS1M19.4 TS1M3
Microsoft® Windows® for x649.4 TS1M19.4 TS1M3
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.